package com.dai.spec.common.enums;

/**
 * 性别类型枚举
 */
public enum SexType {
    MAN("0", "男"),
    WOMAN("1", "女");
    private String code;
    private String value;

    SexType(String code, String value) {
        this.code = code;
        this.value = value;
    }

    public String getCode() {
        return code;
    }

    public String getValue() {
        return value;
    }

    public static String getValueByCode(String code) {
        for (SexType sexTypeEnum : SexType.values()) {
            if (sexTypeEnum.getCode().equals(code)) {
                return sexTypeEnum.getValue();
            }
        }
        return null;
    }
}
